Skip to content

Adding the RAK13300 / RAK11200 ESP32 pair variant#800

Closed
andyshinn wants to merge 4 commits into
meshcore-dev:devfrom
andyshinn:ashinn/rak11200-support
Closed

Adding the RAK13300 / RAK11200 ESP32 pair variant#800
andyshinn wants to merge 4 commits into
meshcore-dev:devfrom
andyshinn:ashinn/rak11200-support

Conversation

@andyshinn
Copy link
Copy Markdown
Contributor

@andyshinn andyshinn commented Sep 17, 2025

This is mostly a copy of RAK4631 as a base and then modeled after the Heltec ESP32 variants. Needed the min spiffs partition since it is a little too large to fit on the default.

One issue I have right now is that it takes a bit of time to boot with errors from I2C:

[  6415][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
[  7422][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
[  8429][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
[  9436][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
[ 10443][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263

I am not sure if that is a sensor issue or not. Would like some guidance on the I2C errors.

@andyshinn andyshinn force-pushed the ashinn/rak11200-support branch from de189e5 to 00425c2 Compare September 17, 2025 15:57
@andyshinn andyshinn marked this pull request as ready for review September 20, 2025 16:44
@andyshinn
Copy link
Copy Markdown
Contributor Author

Per Discord message it is possible that the I2C errors are normal. Opening for review and feedback.

Comment thread variants/rak11200/RAK11200Board.h Outdated
@andyshinn
Copy link
Copy Markdown
Contributor Author

Fixed the pin assignment and also disabled some sensors causing long startup times and adjusted the voltage multiplier to be closer to real measurements.

@andyshinn andyshinn force-pushed the ashinn/rak11200-support branch from 0c53a63 to 1795fc2 Compare December 1, 2025 01:57
@zenire
Copy link
Copy Markdown

zenire commented Dec 13, 2025

Any support/help needed to get this merged? Running this on my RAK13300/RAK11200 right now and working fine.

Copilot AI review requested due to automatic review settings January 21, 2026 03:24
@andyshinn andyshinn force-pushed the ashinn/rak11200-support branch from 1795fc2 to f59e2b5 Compare January 21, 2026 03:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for the RAK11200 WisBlock ESP32 module paired with the RAK13300 LoRa module (SX1262). The implementation follows the pattern of similar ESP32-based variants like Heltec boards and uses the RAK4631 as a base reference. The variant includes configuration for LoRa communication, I2C sensors, GPIO mappings, and uses the min_spiffs partition scheme to accommodate the 4MB flash limitation.

Changes:

  • Added RAK11200 board variant files including pin definitions, board-specific class, and build configurations
  • Configured SX1262 radio with DIO2 as RF switch and 1.8V TCXO
  • Created PlatformIO build environments for repeater, room server, companion radio (USB/BLE), terminal chat, and sensor applications

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
variants/rak11200/variant.h Pin definitions and WisBlock GPIO mappings for RAK11200 + RAK13300
variants/rak11200/target.h Header declarations for radio driver, board, sensors, and RTC
variants/rak11200/target.cpp Implementation of radio initialization and configuration functions
variants/rak11200/platformio.ini Build configurations for multiple RAK11200 application environments
variants/rak11200/pins_arduino.h Arduino-compatible pin mappings for the RAK11200
variants/rak11200/RAK11200Board.h Board class definition with LoRa pin assignments and battery monitoring
variants/rak11200/RAK11200Board.cpp Board initialization and battery voltage reading implementation
boards/wiscore_rak11200.json PlatformIO board definition with ESP32 specifications

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +7
#define I2C_SDA 21
#define I2C_SCL 22
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The I2C pins defined here (SDA=21, SCL=22) conflict with the platformio.ini configuration (PIN_BOARD_SDA=4, PIN_BOARD_SCL=5) and pins_arduino.h (SDA=4, SCL=5). This inconsistency is likely the root cause of the I2C errors mentioned in the PR description. According to the RAK11200 documentation, the correct I2C pins should be GPIO4 (SDA) and GPIO5 (SCL). Please update these values to match the other files.

Suggested change
#define I2C_SDA 21
#define I2C_SCL 22
#define I2C_SDA 4
#define I2C_SCL 5

Copilot uses AI. Check for mistakes.
#define LED_PIN_2 2 // WB_LED2 - Secondary LED

// LoRa radio module pins for RAK11200 + RAK13300 SX1262
#define P_LORA_DIO_1 22 // WB_IO6 - DIO1 interrupt pin
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin conflict detected: P_LORA_DIO_1 is assigned to GPIO22, which is the same pin as WB_IO6 (line 53). Additionally, GPIO22 is defined as I2C_SCL at line 7. This creates a three-way pin conflict. According to the RAK13300 documentation and WisBlock slot mapping, DIO1 should typically be on WB_IO6 (GPIO22), but I2C_SCL should be on GPIO5. Please resolve this conflict by correcting the I2C pin definitions.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +10
#define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET)
#define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5)
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P_LORA_BUSY is redefined here as GPIO13, which conflicts with the definition in variant.h (line 28) where it's set to RADIOLIB_NC. The RAK11200Board.h definition should be removed or both files need to be aligned. According to the RAK13300 module documentation, if BUSY is connected, it should be on WB_IO5 (GPIO13), but variant.h indicates it's not connected (RADIOLIB_NC). Please clarify the actual hardware configuration and make these definitions consistent.

Suggested change
#define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET)
#define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5)
#define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET)
#ifndef P_LORA_BUSY
#define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5)
#endif

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +19
void RAK11200Board::begin() {
ESP32Board::begin();

pinMode(PIN_VBAT_READ, INPUT);

pinMode(SX126X_POWER_EN, OUTPUT);
digitalWrite(SX126X_POWER_EN, HIGH);
delay(10); // give sx1262 some time to power up

#ifdef PIN_USER_BTN
pinMode(PIN_USER_BTN, INPUT_PULLUP);
#endif

#ifdef PIN_USER_BTN_ANA
pinMode(PIN_USER_BTN_ANA, INPUT_PULLUP);
#endif
}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RAK11200Board::begin() method is missing a call to Wire.begin(). While ESP32Board::begin() already calls Wire.begin() with PIN_BOARD_SDA and PIN_BOARD_SCL, this board class doesn't call the parent begin() method. Without calling ESP32Board::begin(), the I2C bus will not be initialized, which explains the I2C errors mentioned in the PR description. Add ESP32Board::begin() as the first line of this method.

Copilot uses AI. Check for mistakes.
#define P_LORA_MOSI 25 // GPIO25 (ESP32 pin 10 -> SPI_MOSI)
#define SX126X_POWER_EN 27 // GPIO27 (ESP32 pin 12 -> IO2)
#define PIN_VBAT_READ 36 // WB_A0 for battery reading
#define ADC_MULTIPLIER (3 * 1.73 * 1.110 * 1000)
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent ADC_MULTIPLIER values: variant.h defines it as 1.85 (line 20) while RAK11200Board.h defines it as (3 * 1.73 * 1.110 * 1000) which equals approximately 5763.9. These values are dramatically different and will result in incorrect battery voltage readings. According to the WisBlock RAK11200 documentation and similar RAK boards, the ADC_MULTIPLIER should typically account for the voltage divider ratio and ADC characteristics. Please verify the correct voltage divider configuration and use a consistent value across both files.

Suggested change
#define ADC_MULTIPLIER (3 * 1.73 * 1.110 * 1000)
#define ADC_MULTIPLIER 1.85f

Copilot uses AI. Check for mistakes.
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RAK11200 module does not have Ethernet capability. The connectivity list incorrectly includes "ethernet" alongside wifi, bluetooth, and CAN. According to the RAK11200 datasheet, it only supports WiFi 2.4GHz (802.11b/g/n) and Bluetooth 5.0. Please remove "ethernet" from the connectivity array.

Suggested change
"ethernet",

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
"ethernet",
"can"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RAK11200 module does not have CAN (Controller Area Network) capability. The connectivity list incorrectly includes "can" alongside wifi and bluetooth. According to the RAK11200 datasheet, it only supports WiFi 2.4GHz (802.11b/g/n) and Bluetooth 5.0. Please remove "can" from the connectivity array.

Suggested change
"ethernet",
"can"
"ethernet"

Copilot uses AI. Check for mistakes.
@weebl2000
Copy link
Copy Markdown
Contributor

@andyshinn do you still want this variant? If so I can help you tidy up and get this merged.

@andyshinn
Copy link
Copy Markdown
Contributor Author

It would be nice to have, yes!

@weebl2000
Copy link
Copy Markdown
Contributor

It would be nice to have, yes!

Made a PR to your fork andyshinn#1 - if you merge that I think this will be good to go.

@andyshinn
Copy link
Copy Markdown
Contributor Author

Thanks!

@andyshinn andyshinn closed this Mar 5, 2026
@weebl2000
Copy link
Copy Markdown
Contributor

Closed in favor of #1925 - all PR comments are addressed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants